// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package com.ec.service;

public abstract class _ProductServiceDisp extends Ice.ObjectImpl implements ProductService
{
    protected void
    ice_copyStateFrom(Ice.Object __obj)
        throws java.lang.CloneNotSupportedException
    {
        throw new java.lang.CloneNotSupportedException();
    }

    public static final String[] __ids =
    {
        "::Ice::Object",
        "::com::ec::service::ProductService"
    };

    public boolean
    ice_isA(String s)
    {
        return java.util.Arrays.binarySearch(__ids, s) >= 0;
    }

    public boolean
    ice_isA(String s, Ice.Current __current)
    {
        return java.util.Arrays.binarySearch(__ids, s) >= 0;
    }

    public String[]
    ice_ids()
    {
        return __ids;
    }

    public String[]
    ice_ids(Ice.Current __current)
    {
        return __ids;
    }

    public String
    ice_id()
    {
        return __ids[1];
    }

    public String
    ice_id(Ice.Current __current)
    {
        return __ids[1];
    }

    public static String
    ice_staticId()
    {
        return __ids[1];
    }

    public final boolean
    addDirectory(int parentid, float tax, String dirName)
    {
        return addDirectory(parentid, tax, dirName, null);
    }

    public final DateTime
    getCurrentDate()
    {
        return getCurrentDate(null);
    }

    public final DateTime[]
    getTimes()
    {
        return getTimes(null);
    }

    public final void
    printCurrentDate(DateTime currentDate)
    {
        printCurrentDate(currentDate, null);
    }

    public final void
    printString(String s)
    {
        printString(s, null);
    }

    public final String[]
    queryBySql(String sql)
    {
        return queryBySql(sql, null);
    }

    public final String[]
    queryBySqlNotType(String sql)
    {
        return queryBySqlNotType(sql, null);
    }

    public final boolean
    updateDirectory(int id, String dirName, float tax)
    {
        return updateDirectory(id, dirName, tax, null);
    }

    public static Ice.DispatchStatus
    ___getTimes(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        DateTime[] __ret = __obj.getTimes(__current);
        DateTimeArrayHelper.write(__os, __ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___getCurrentDate(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        __inS.is().skipEmptyEncaps();
        IceInternal.BasicStream __os = __inS.os();
        DateTime __ret = __obj.getCurrentDate(__current);
        __ret.__write(__os);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___printCurrentDate(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        DateTime currentDate;
        currentDate = new DateTime();
        currentDate.__read(__is);
        __is.endReadEncaps();
        __obj.printCurrentDate(currentDate, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___printString(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        String s;
        s = __is.readString();
        __is.endReadEncaps();
        __obj.printString(s, __current);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___queryBySql(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        String sql;
        sql = __is.readString();
        __is.endReadEncaps();
        IceInternal.BasicStream __os = __inS.os();
        String[] __ret = __obj.queryBySql(sql, __current);
        StringArrayHelper.write(__os, __ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___queryBySqlNotType(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        String sql;
        sql = __is.readString();
        __is.endReadEncaps();
        IceInternal.BasicStream __os = __inS.os();
        String[] __ret = __obj.queryBySqlNotType(sql, __current);
        StringArrayHelper.write(__os, __ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___addDirectory(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        int parentid;
        parentid = __is.readInt();
        float tax;
        tax = __is.readFloat();
        String dirName;
        dirName = __is.readString();
        __is.endReadEncaps();
        IceInternal.BasicStream __os = __inS.os();
        boolean __ret = __obj.addDirectory(parentid, tax, dirName, __current);
        __os.writeBool(__ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    public static Ice.DispatchStatus
    ___updateDirectory(ProductService __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
        __checkMode(Ice.OperationMode.Normal, __current.mode);
        IceInternal.BasicStream __is = __inS.is();
        __is.startReadEncaps();
        int id;
        id = __is.readInt();
        String dirName;
        dirName = __is.readString();
        float tax;
        tax = __is.readFloat();
        __is.endReadEncaps();
        IceInternal.BasicStream __os = __inS.os();
        boolean __ret = __obj.updateDirectory(id, dirName, tax, __current);
        __os.writeBool(__ret);
        return Ice.DispatchStatus.DispatchOK;
    }

    private final static String[] __all =
    {
        "addDirectory",
        "getCurrentDate",
        "getTimes",
        "ice_id",
        "ice_ids",
        "ice_isA",
        "ice_ping",
        "printCurrentDate",
        "printString",
        "queryBySql",
        "queryBySqlNotType",
        "updateDirectory"
    };

    public Ice.DispatchStatus
    __dispatch(IceInternal.Incoming in, Ice.Current __current)
    {
        int pos = java.util.Arrays.binarySearch(__all, __current.operation);
        if(pos < 0)
        {
            throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
        }

        switch(pos)
        {
            case 0:
            {
                return ___addDirectory(this, in, __current);
            }
            case 1:
            {
                return ___getCurrentDate(this, in, __current);
            }
            case 2:
            {
                return ___getTimes(this, in, __current);
            }
            case 3:
            {
                return ___ice_id(this, in, __current);
            }
            case 4:
            {
                return ___ice_ids(this, in, __current);
            }
            case 5:
            {
                return ___ice_isA(this, in, __current);
            }
            case 6:
            {
                return ___ice_ping(this, in, __current);
            }
            case 7:
            {
                return ___printCurrentDate(this, in, __current);
            }
            case 8:
            {
                return ___printString(this, in, __current);
            }
            case 9:
            {
                return ___queryBySql(this, in, __current);
            }
            case 10:
            {
                return ___queryBySqlNotType(this, in, __current);
            }
            case 11:
            {
                return ___updateDirectory(this, in, __current);
            }
        }

        assert(false);
        throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
        __os.writeTypeId(ice_staticId());
        __os.startWriteSlice();
        __os.endWriteSlice();
        super.__write(__os);
    }

    public void
    __read(IceInternal.BasicStream __is, boolean __rid)
    {
        if(__rid)
        {
            __is.readTypeId();
        }
        __is.startReadSlice();
        __is.endReadSlice();
        super.__read(__is, true);
    }

    public void
    __write(Ice.OutputStream __outS)
    {
        Ice.MarshalException ex = new Ice.MarshalException();
        ex.reason = "type com::ec::service::ProductService was not generated with stream support";
        throw ex;
    }

    public void
    __read(Ice.InputStream __inS, boolean __rid)
    {
        Ice.MarshalException ex = new Ice.MarshalException();
        ex.reason = "type com::ec::service::ProductService was not generated with stream support";
        throw ex;
    }
}
